﻿<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="./css/zj_radio.css">
<title></title>
<style type="text/css">
legend {
	font-family: "微软雅黑";
	font-size: 20px;
}

fieldset {
	border: 1px dashed #ccc;
	margin: 5px;
	padding: 20px;
}
</style>
</head>
<body>
	<fieldset>
		<legend>radio</legend>
		<form action="">
			<input type="hidden" id="radio" />
			<input type="button" value="取值" id="getValue">
		</form>
	</fieldset>
	<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.8.3/jquery.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="./js/zj_radio.js"></script>
	<script type="text/javascript">
		$("#radio").zj_radio({
			name : "sex",
			data : [ {
				"id" : "1",
				"name" : "哈哈"
			}, {
				"id" : "2",
				"name" : "呵呵"
			}, {
				"id" : "3",
				"name" : "嘿嘿"
			} ],
			valueField : "id",
			textField : "name"
		});
		$("#getValue").click(function() {
			alert($("input[name=sex]:checked").val())
		});
	</script>
</body>
</html>